<table width="100%" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
    <td class="bodyline"><table width="100%" cellspacing="0" cellpadding="0" border="0">
	   <tr>
		  <td>
		     <%= link_to image_tag("styles/subSilver/logo_phpBB.gif", :border => 0, :alt => $system.name+" index", :vspace => 1), :controller => '' %>
		  </td>
		<td align="center" width="100%" valign="middle"><span class="maintitle"><%= $system.name %>
		</span><br /><span class="gen"><%= $system.description %><br />&nbsp; </span>

<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="center" valign="top" nowrap="nowrap">
<span class="mainmenu">&nbsp;
<%= link_to image_tag("styles/"+@system.css+"/icon_mini_faq.gif", :size => "12x13", :border => 0, :alt => "FAQ", :hspace => 3)+"FAQ", {:controller => 'faq'}, {:class => 'mainmenu'} %>&nbsp;
<%= link_to image_tag("styles/"+@system.css+"/icon_mini_search.gif", :size => "12x13", :border => 0, :alt => "Search", :hspace => 3)+"Search", {:controller => 'search'}, {:class => 'mainmenu'} %>&nbsp;
<%= link_to image_tag("styles/"+@system.css+"/icon_mini_members.gif", :size => "12x13", :border => 0, :alt => "Memberlist", :hspace => 3)+"Memberlist", {:controller => 'user', :action => 'list'}, {:class => 'mainmenu'} %>&nbsp;
<%= link_to image_tag("styles/"+@system.css+"/icon_mini_groups.gif",  :size => "12x13", :border => 0, :alt => "Usergroups", :hspace => 3)+"Usergroups", {:controller => 'group', :action => 'list'}, {:class => 'mainmenu'} %>&nbsp;
<%= link_to image_tag("styles/"+@system.css+"/icon_mini_register.gif",  :size => "12x13", :border => 0, :alt => "Register", :hspace => 3)+"Register", {:controller => 'user', :action => 'signup'}, {:class => 'mainmenu'} %>&nbsp;
</span>
</td>
</tr>
<tr>
    <td height="25" align="center" valign="top" nowrap="nowrap">
    <span class="mainmenu">&nbsp;
    <%= link_to image_tag("styles/"+@system.css+"/icon_mini_profile.gif",  :size => "12x13", :border => 0, :alt => "Profile", :hspace => 3)+"Profile", {:controller => 'profile'}, {:class => 'mainmenu'} %>&nbsp;
    <%= link_to image_tag("styles/"+@system.css+"/icon_mini_message.gif",  :size => "12x13", :border => 0, :alt => "Message", :hspace => 3)+"Log in to check your messages", {:controller => 'messages'}, {:class => 'mainmenu'} %>&nbsp;
    <%= link_to image_tag("styles/"+@system.css+"/icon_mini_login.gif",  :size => "12x13", :border => 0, :alt => "Login", :hspace => 3)+"Log in", {:controller => 'user', :action => 'login'}, {:class => 'mainmenu'} %>&nbsp;
    </span>
    </td>
</tr>
</table>
</td>
</tr>
</table>

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr>
	<td align="left" valign="bottom">
	<span class="gensmall">
	The time now is <%= Time.now.strftime('%b %d, %Y %I:%M %p') %><br />
	</span>
	<span class="nav">
	<%= link_to @system.name+" Forum Index", {:controller => ''}, {:class => "nav"} %>
	</span>
	</td>
	<td align="right" valign="bottom" class="gensmall">

		<a href="search.php?search_id=unanswered" class="gensmall">View unanswered posts</a></td>
  </tr>
</table>

<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
	<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;Forum&nbsp;</th>
	<th width="50" class="thTop" nowrap="nowrap">&nbsp;Topics&nbsp;</th>
	<th width="50" class="thTop" nowrap="nowrap">&nbsp;Posts&nbsp;</th>

	<th class="thCornerR" nowrap="nowrap">&nbsp;Last Post&nbsp;</th>
  </tr>
    <% for forum in @forums %>
    <tr>
	<td class="row1" align="center" valign="middle" height="50">
	   <%= image_tag("styles/subSilver/folder_big.gif", :size => '46x25', :alt => "No new posts", :title => "No new posts") %>
	</td>

	<td class="row1" width="100%" height="50">
	   <span class="forumlink">
	   <%= link_to h(forum.name), :action => 'show', :id => forum %><br />
	  </span> 
	  <span class="genmed"><%=h forum.description %><br />
	  </span>
	  <span class="gensmall">&nbsp; &nbsp;</span></td>
	<td class="row2" align="center" valign="middle" height="50"><span class="gensmall"><%=h forum.topics.size %></span></td>
	<td class="row2" align="center" valign="middle" height="50"><span class="gensmall"><%=h forum.num_posts %></span></td>
	<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> 
	<span class="gensmall">
	   <% latest_topic = forum.latest_topic%>
   	   <% if latest_topic %>
    	   <% latest_post = latest_topic.latest_post %>
           <% latest_user = latest_post.user %>    	   
	       <%=h latest_post.created_at.strftime('%b %d, %Y %I:%M %p') %><br />
           <%= link_to latest_user.login, :controller => 'profile', :action => 'show', :id => latest_user.profile %>
           <%= link_to image_tag('styles/subSilver/icon_latest_reply.gif', :border => 0, :alt => 'View latest post', :title => 'View latest post'), :controller => 'topic', :action => 'show', :id => forum.latest_topic %>
	   <% end %>
</span></td>
  </tr>
    <% end %>
</table>
